::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::Start this batch file, Set which directories & programs we will be using.
::Delete any previously generated files before we begin.
::BuildPath is where the generated files will be created.
@ECHO OFF
CLS
SET BuildPath=..\Medianamik.Core\DAL\SubsonicDALProvider\Generated_dbo
SET Sonic=SubCommander\sonic.exe
SET Generate=generate /config subsonicDbo.config /out %BuildPath%
IF EXIST %BuildPath% del %BuildPath%\*.cs 
GOTO GenerateDatabase

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::Start generating your DAL files
:GenerateDatabase
CLS
ECHO Generate 
ECHO.
%Sonic% %Generate% 
GOTO End

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:FailedDelete
CLS
ECHO SubSonic Builder
ECHO --------------------------------------------------
ECHO Error:
ECHO.
ECHO The BuildPath directory could not be deleted, one or more files may be open in another application.
GOTO End

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::End of the batch file
:End
ECHO.
ECHO Sub Sonic Builder... Done.
ECHO.

pause